package com.sky.config;

import com.sky.constant.LocalUploadConstant;
import com.sky.utils.LocalFileUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 本地文件上传的配置类 便于使用自动注入
 */
@Configuration
@Slf4j
public class LocalFileUtilsConfiguration {

    @Bean //Bean结合Autowired即可
    public LocalFileUtil localFileUtil(){
        log.info("开始新建本地文件上传的配置");
        return new LocalFileUtil(LocalUploadConstant.LOCAL_FILE_PATH);
    }

}
